﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models.fountain {
    import org.robotlegs.mvcs.*;

    public class FountainModel extends Actor {

        private var _matrix:Array;

        private static const NEXT_ELDER_IN:int = 25;

        public function FountainModel(){
            this._matrix = [];
            super();
        }
        public function addEntry(_arg1:Array):void{
            var _local2:Object = {};
            _local2.elder = _arg1[0];
            _local2.cured = _arg1[1];
            this._matrix.push(_local2);
            this._matrix.sortOn("cured", Array.NUMERIC);
        }
        public function getNextElderIn(_arg1:int):int{
            var _local2:Object;
            var _local3:int;
            for each (_local2 in this._matrix) {
                if (_local2.cured > _arg1){
                    return ((_local2.cured - _arg1));
                };
            };
            _local3 = (NEXT_ELDER_IN - (_arg1 % NEXT_ELDER_IN));
            return (_local3);
        }

    }
}//package net.wooga.pets.models.fountain 
